<?php get_header(); ?>

<?php if( simpax_sidebar() == "right_connected" ) : ?>
<div id="uber_page">
<?php endif; ?>
<div id="page">

<div class="container">
<?php if(is_home()) :

	if( simpax_greetings() ) :
		// hallo user!
		if( isset($_COOKIE['comment_author_'.COOKIEHASH]) ) {
			$comment_author = $_COOKIE['comment_author_'.COOKIEHASH]; ?>
	      <h3>Hallo <?php echo $comment_author; ?>!
	      Sch&ouml;n, dass du wieder da bist! <small><?php wp_register('','/'); ?><?php wp_loginout(); ?>?</small></h3>
		<?php } else if ( $user_identity ) { ?>
	      <h3>Hallo <?php echo $user_identity; ?>!
	      Sch&ouml;n, dass du wieder da bist!
 	      <small> &bull; <?php wp_register('',' &bull; '); ?><?php wp_loginout(); ?></small></h3>
		<?php };
	endif;
	
else : ?>
<h3>
	<?php if (is_category()) { ?>
		<?php printf( __('Artikel in der Kategorie \'%s\'','simpax'), single_cat_title('', false)) ?>

		<?php } elseif (is_day()) { ?>
		<?php printf( __('Archiv vom %s','simpax'), get_the_time( __('j. F Y','simpax')))?>

		<?php } elseif (is_month()) { ?>
		<?php printf( __('Archiv f&uuml;r %s','simpax'), get_the_time( __('F Y','simpax'))) ?>

		<?php } elseif (is_year()) { ?>
		<?php printf( __('Archiv f&uuml;r %s','simpax'), get_the_time('Y')) ?>

		<?php } elseif (is_search()) { ?>
		<?php printf( __('Suchergebnisse f&uuml;r \'%s\'','simpax'), $s) ?>

		<?php } elseif (is_author()) { ?>
		<?php _e('Autoren-Archiv', 'simpax'); ?>

		<?php } elseif ((function_exists('is_tag')) && (is_tag())) { ?>
		<?php printf( __('Tag-Archiv f&uuml;r \'%s\'','simpax'), get_query_var('tag')); ?>

		<?php } elseif (is_paged()) { ?>
		<?php _e('Blog Archiv', 'simpax'); ?>
		<?php } ?>
</h3>
<?php endif; ?>
<?php if ( !function_exists('dynamic_sidebar')
        || !dynamic_sidebar('Container') ) : ?>
<?php endif; ?>

</div>

<?php if(simpax_styles_showcase()) : ?>
<div class="container">
<h3>Stylesheet Showcase</h3>
<ul class="cax_ul_radio">
<?php simpax_get_styles_showcase(); ?>
</ul>
<br style="clear: both;" />
</div>
<?php endif; ?>

<?php if (have_posts()) :
      while (have_posts()) : the_post();
	  
	  if ( simpax_is_asides() and !simpax_accordion() ) : ?>
		<!-- This post is an aside -->
		
<div class="asides" id="<?php the_ID(); ?>">
	
	<h2 class="asides-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?> &bull; <?php comments_number(__('0 Kommentare','simpax'), __('ein Kommentar','simpax'), '% '.__('Kommentare','simpax'), '', ''); ?> &bull; <?php the_time('d. M Y'); ?>">&raquo;</a></h2>
	<?php echo the_content(); ?>
	
</div>

<br style="clear: both;" />
<?php if(simpax_is_trenn()) { ?>
<img src="<?php simpax_trenn(); ?>" alt="" class="centered" />
<?php } ?>

	<?php else : ?>

<!-- POST -->
<?php if(simpax_hilight_news()) {
	if((int)((time() - strtotime($post->post_date)) / 86400) < 1 ) echo '<div class="star">';
} else { echo '<div class="fullpost">'; } ?>

<h2 class="title-post">
	<a href="<?php the_permalink(); ?>" title="<?php _e('Artikelseite von','simpax');?> <?php the_title(); ?>" class="title-span"><?php the_title(); ?></a>
</h2>

<div class="accordion">

<?php if( simpax_date() == "top" ) : ?>

<div class="date_alt">
Geschrieben am <?php the_time('d. M Y'); ?>, bisher 
<?php if(simpax_cmt_number()) { ?>
<?php comments_popup_link(__('0 Kommentare','simpax'), __('ein Kommentar','simpax'), '% '.__('Kommentare','simpax'), '', ''); ?>
<?php } ?>
<?php if(simpax_show_author()) { echo " von "; the_author_posts_link('namefl'); } ?>
<?php if(simpax_editlink()) { echo " &bull; "; edit_post_link(__('Artikel bearbeiten','simpax')); } ?>
</div>

<?php endif; ?>

<?php if( simpax_date() == "right" ) : ?>

<div class="date">
	<span class="date_day"><?php the_time('d'); ?></span>
	<span class="date_month"><?php the_time('M'); ?></span>
	<span class="date_year"><?php the_time('Y'); ?></span>
	<?php if(simpax_cmt_number()) { ?>
	<span class="date_comments">
	<?php if(simpax_date_icons()) { 
			comments_popup_link('<img src="'.get_bloginfo(stylesheet_directory).'/img/comment.png" alt="'.__('Kommentare','simpax').'" /> 0', '<img src="'.get_bloginfo(stylesheet_directory).'/img/comment.png" alt="'.__('Kommentare','simpax').'" /> 1', '<img src="'.get_bloginfo(stylesheet_directory).'/img/comment.png" alt="'.__('Kommentare','simpax').'" /> %', '', '');
		} else { 
			comments_popup_link('0', '1', '%', '', '');	
		} ?>
	</span>
	<?php } ?>
	<?php if(simpax_editlink()) { ?>
	<?php if(simpax_date_icons()) { 
			edit_post_link('<img src="'.get_bloginfo(stylesheet_directory).'/img/pencil.png" alt="edit" /> e','<span class="date_comments">', '</span>'); 
		} else {
			edit_post_link('e','<span class="date_comments">', '</span>');
		} ?>
	<?php } ?>
	<?php if(simpax_show_author()) { ?>
	<span class="date_comment">
	<?php if(simpax_date_icons()) { ?>
		<img src="<?php bloginfo('stylesheet_directory'); ?>/img/user.png" alt="author" class="date_author_img" /> 
	<?php } ?>
	<span class="date_author"><?php the_author_posts_link('namefl'); ?></span>
	</span>
	<?php } ?>
</div>

<?php endif; ?>

<div class="post" id="<?php the_ID(); ?>">
<?php if(simpax_excerpt()) : ?>
<?php the_excerpt(); ?>
<?php else: ?>
<?php the_content(__('Den kompletten Artikel lesen &raquo;','simpax')); ?>
<?php endif; ?>
</div>

<?php if( simpax_date() == "bottom" ) : ?>

<div class="date_alt">
Geschrieben am <?php the_time('d. M Y'); ?>, bisher 
<?php if(simpax_cmt_number()) { ?>
<?php comments_popup_link(__('0 Kommentare','simpax'), __('ein Kommentar','simpax'), '% '.__('Kommentare','simpax'), '', ''); ?>
<?php } ?>
<?php if(simpax_show_author()) { echo " von "; the_author_posts_link('namefl'); } ?>
<?php if(simpax_editlink()) { echo " &bull; "; edit_post_link(__('Artikel bearbeiten','simpax')); } ?>
</div>

<?php endif; ?>

</div>
<br style="clear: both;" />


<br style="clear: both;" />
<?php if(simpax_is_trenn()) { ?>
<img src="<?php simpax_trenn(); ?>" alt="" class="centered" />
<?php } ?>

</div>

<?php endif; // asides or not ?>

<?php endwhile;
	else : ?>
<h2 class="title-post"><?php _e('Leider keine Artikel vorhanden...','simpax');?></h2>
<?php endif; ?>

<br style="clear:both;" />
<div id="pagenav">
<?php pagenav(array('tooltip_text'=>__('Seite','simpax'), 'next'=>__('Weiterbl&auml;ttern','simpax').' &raquo;', 'prev'=>'&laquo;'.__('Zur&uuml;ckbl&auml;ttern','simpax'))); ?>
</div>

<?php if( simpax_slide() and simpax_bottombar() ) : ?>
<img scr="<?php bloginfo('stylesheet_directory'); ?>/img/slide.png" class="centered" id="slide-bottombar" alt="slide bottombar" />
<?php endif; ?>

</div><?php // #page ?>


<?php get_footer(); ?>